.386
.model flat,stdcall
option casemap:none
include msvcrt.inc
includelib msvcrt.lib
printf  proto C:dword,:dword
.data
lb_write_int db '%d',0
lb_writeln_int db '%d',0ah,0dh,0
lb_write_real db '%lf',0
lb_writeln_real db '%lf',0ah,0dh,0
lb_tmp db 0, 0, 0, 0, 0, 0, 0, 0
lb_read_int db '%d',0
lb_read_real db '%f',0

.code
f:
sub esp, 4
mov edi, 4
mov esi, ecx
add esi, edi
mov eax, [esi]; calculate ExpId 
push eax
mov eax, 0
push eax
pop ebx
pop eax
add eax, ebx
push eax
mov edi, 8
mov esi, ecx
add esi, edi
mov eax, [esi]; calculate ExpId 
pop eax
mov [esi-0], eax
add esp, 4
ret
fv:
sub esp, 4
mov eax, 0
push eax
mov edi, 4
mov esi, ecx
add esi, edi
mov eax, [esi]; calculate ExpId 
pop eax
mov [esi-0], eax
mov eax, 0
push eax
mov edi, 8
mov esi, ecx
add esi, edi
mov eax, [esi]; calculate ExpId 
pop eax
mov [esi-0], eax
mov edi, 4
mov esi, ecx
add esi, edi
mov eax, [esi]; calculate ExpId 
push eax
mov edi, 8
mov esi, ecx
add esi, edi
mov eax, [esi]; calculate ExpId 
push eax
pop ebx
pop eax
add eax, ebx
push eax
mov edi, 12
mov esi, ecx
add esi, edi
mov eax, [esi]; calculate ExpId 
pop eax
mov [esi-0], eax
add esp, 4
ret
p:
sub esp, 4
mov edi, 4
mov esi, ecx
add esi, edi
mov eax, [esi]; calculate ExpId 
push eax
mov eax, 0
push eax
pop ebx
pop eax
add eax, ebx
push eax
mov edi, 4
mov esi, ecx
add esi, edi
mov eax, [esi]; calculate ExpId 
pop eax
mov [esi-0], eax
add esp, 4
ret
pv:
sub esp, 4
mov edi, 4
mov esi, ecx
add esi, edi
mov eax, [esi]; calculate ExpId 
push eax
mov eax, 0
push eax
pop ebx
pop eax
add eax, ebx
push eax
mov edi, 4
mov esi, ecx
add esi, edi
mov eax, [esi]; calculate ExpId 
pop eax
mov [esi-0], eax
add esp, 4
ret
main PROC
mov ecx, esp
sub esp, 8
push eax
mov eax, 0
push eax
push ecx
mov ecx, esp
call f
pop ecx
pop eax
pop eax
push eax
mov edi, -8
mov esi, ecx
add esi, edi
mov eax, [esi]; calculate ExpId 
pop eax
mov [esi-0], eax
push eax
mov eax, 0
push eax
mov eax, 0
push eax
push ecx
mov ecx, esp
call fv
pop ecx
mov eax, 0
pop eax
mov [esi],eax
mov eax, 0
pop eax
mov [esi],eax
pop eax
push eax
mov edi, -8
mov esi, ecx
add esi, edi
mov eax, [esi]; calculate ExpId 
pop eax
mov [esi-0], eax
mov edi, -8
mov esi, ecx
add esi, edi
mov eax, [esi]; calculate ExpId 
push eax
push ecx
mov ecx, esp
call 0
pop ecx
pop eax
mov edi, -8
mov esi, ecx
add esi, edi
mov eax, [esi]; calculate ExpId 
push eax
push ecx
mov ecx, esp
call 0
pop ecx
mov edi, -8
mov esi, ecx
add esi, edi
mov eax, [esi]; calculate ExpId 
pop eax
mov [esi],eax
add esp, 8
ret
main ENDP
END main

